#ifndef MOVIE_H
#define MOVIE_H


//----------------------------------------------------------------------------//
// I N C L U D E   Q T                                                        //
//----------------------------------------------------------------------------//
#include <QObject>


//----------------------------------------------------------------------------//
// I N C L U D E   P R O J E C T                                              //
//----------------------------------------------------------------------------//
#include "theater.h"
#include "timetable.h"


//----------------------------------------------------------------------------//
// T Y P E S   &   D E F I N I T I O N S                                      //
//----------------------------------------------------------------------------//
// selected to be displayed
typedef enum
{
  MOVIE_NOT_SELECTED,
  MOVIE_SELECTED
} MovieSelection_t;


//----------------------------------------------------------------------------//
// C L A S S   D E C L A R A T I O N                                          //
//----------------------------------------------------------------------------//
class Movie : public QObject
{
    Q_OBJECT
  public:
    //------------------------------------------------------------------------//
    // C O N T R U C T O R S                                                  //
    //------------------------------------------------------------------------//
    explicit Movie(QString    title,
                   QString    duration);


    //------------------------------------------------------------------------//
    // P U B L I C   M E T H O D S   D E C L A R A T I O N                    //
    //------------------------------------------------------------------------//
    // SETTER
    void setSelectedDub(MovieDub_t& dub);
    void setSelected3D(Movie3D_t& threedim);
    void setUrlIMDb(QString& url);
    void setRateIMDb(QString& rate);
    void setUrlAllocine(QString& url);
    void setRateAllocine(QString& rate);
    void setPoster(QString& url);
    // GETTER
    QString getTitle(void);
    QTime getDuration(void);
    MovieDub_t getDub(void);
    MovieDub_t getDubSelected(void);
    Movie3D_t get3D(void);
    Movie3D_t get3DSelected(void);
    QUrl getPoster(void);
    QUrl getUrlIMDb(void);
    float getRateIMDb(void);
    QUrl getUrlAllocine(void);
    float getRateAllocine(void);
    // operator
    bool operator==(Movie& right);
    // COMPUTE
    void addTimeTable(Theater*&   thtr,
                      QDate&      date,
                      MovieDub_t& dub,
                      Movie3D_t&  threed,
                      QTime&      time);
    bool removeTimeTable(Theater *thtr);


  /* signals: */
    //------------------------------------------------------------------------//
    // S I G N A L S                                                          //
    //------------------------------------------------------------------------//


  /* public slots: */
    //------------------------------------------------------------------------//
    // S L O T S                                                              //
    //------------------------------------------------------------------------//


  private:
    //------------------------------------------------------------------------//
    // P R I V A T E   A T T R I B U T E S   D E C L A R A T I O N            //
    //------------------------------------------------------------------------//
    QString           Title;
    QTime             Duration;
    QUrl              Poster;
    QList<TimeTable*> Times;    // contains list of theaters

    QUrl  UrlIMDb;
    float RateIMDb;
    QUrl  UrlAllocine;
    float RateAllocine;

    MovieSelection_t Selected;
    MovieDub_t       DubSelected;
    Movie3D_t        ThreeDSelected;
};


#endif // MOVIE_H
